Package edu.claflin.finder.logic
Class BronKerboschHandler
- java.lang.Object
-
- edu.claflin.finder.logic.BronKerboschHandler
-
public class BronKerboschHandler extends java.lang.ObjectCode for finding maximal clique and maximnal Complete Bipartite of a graph using the Bron-Kerbosch algorithm. https://en.wikipedia.org/wiki/Bron%E2%80%93Kerbosch_algorithm
-
-
Constructor Summary
Constructors Constructor Description BronKerboschHandler()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidbronKerbosch(java.util.ArrayList<Graph> results, Graph r, Graph p, Graph x, Graph orig)Recursive helper method to do the above.static java.util.ArrayList<Graph>bronKerboschBiclique(Graph graph)Bipartite Bron Kerbosch algorithm that uses the above to find all complete bipartite graphs within a bipartite graph.static java.util.ArrayList<Graph>bronKerboschClique(Graph graph)Given a graph, finds all complete subgraphs.static java.util.ArrayList<Graph>maximumBicliques(Graph graph)Gets the Maximum Complete Bipartite Graphs by Node count from the input Graph using Bron-Kersboch.static java.util.ArrayList<Graph>maximumCliques(Graph graph)Given a graph, finds all complete subgraphs, and then returns the largest one.
-
-
-
Method Detail
-
bronKerbosch
public static void bronKerbosch(java.util.ArrayList<Graph> results, Graph r, Graph p, Graph x, Graph orig)
Recursive helper method to do the above.- Parameters:
results- result list. Passed between recursive calls to create outputr- graph r in wikipedia linkp- graph p in wikipedia linkx- graph x in wikipedia linkorig- original Graph containing edges
-
bronKerboschClique
public static java.util.ArrayList<Graph> bronKerboschClique(Graph graph)
Given a graph, finds all complete subgraphs.- Parameters:
graph- the graph- Returns:
- an ArrayList of complete subgraphs, unordered
-
bronKerboschBiclique
public static java.util.ArrayList<Graph> bronKerboschBiclique(Graph graph)
Bipartite Bron Kerbosch algorithm that uses the above to find all complete bipartite graphs within a bipartite graph. This is done by adding edges between every node in both groups, using the above algorithm, and removing all the added edges later on. THIS ONLY WORKS ON GRAPHS THAT ARE BIPARTITE!- Parameters:
graph- the bipartite graph- Returns:
- array list of bipartite graphs
-
maximumCliques
public static java.util.ArrayList<Graph> maximumCliques(Graph graph)
Given a graph, finds all complete subgraphs, and then returns the largest one.- Parameters:
graph- the graph- Returns:
- the largest complete subgraph (clique)
-
-